/**
 * @version 1.0
 * @auyhor dongxin
 * @date 2020/12/8 9:38
 **/
public class CodeTeST {
    static int i=0;
    {
        i=3;
    }
    static {
        i=i++;
    };

    {
        i=2;
    }
    Integer outI(){
        return i;
    }

    public static void main(String[] args) {
        Child c1=new Child("C1");
        Child c2=new Child("C2");
    }

}

    class Child {

        private static String name;

        static {
            System.out.println("我是静态代码块！！！！！！所以我不能用this~"+name);
        }

        {
            System.out.println(this+"我是动态代码块"+this.name);
        }
        public Child(String name) {
            this.name = name;
            System.out.println(this+"我是构造方法"+this.name);
        }

        public static void main(String[] args) {
            Child child=new Child("张三");
            System.out.println(child+"普通方法"+child.name);
        }
    }
